/**
 * 
 */
package com.tvshows.front.listener.command;

import com.tvshows.front.factory.TypeUI;
import com.tvshows.front.factory.ViewFactory;
import com.tvshows.front.listener.command.interfaces.FavoriteCommand;
import com.tvshows.front.ui.dialog.ActionsUI;
import com.tvshows.front.ui.favorite.UpsideCompositeFavoriteUI;
import com.tvshows.front.view.dialog.ActionsView;
import com.tvshows.interactions.ObserverBdd;

/**
 * @author Tangi Midy
 */
public class ModifyFavoriteCommand
    extends FavoriteCommand
{

    /**
     * The {@link UpsideCompositeFavoriteUI}
     */
    private UpsideCompositeFavoriteUI upsideComposite;

    /**
     * The {@link ActionsView}
     */
    private ActionsUI actionsView;

    /**
     * Constructeur
     */
    public ModifyFavoriteCommand( UpsideCompositeFavoriteUI upsideComposite )
    {
        this.upsideComposite = upsideComposite;
    }

    /**
     * @see com.tvshows.front.listener.command.interfaces.FavoriteCommand#executeCommand()
     */
    @Override
    public void executeCommand()
    {

        actionsView = (ActionsUI) ViewFactory.getUI( TypeUI.ACTIONS_VIEW );
        actionsView.setModify( true );
        actionsView.openShell( upsideComposite );
        ObserverBdd.getObserverBdd().activeDeleteOnFavorite();

    }

}
